<?php

/**
 * 双十一抽奖
 * File Name：LotteryController.php
 * File Encoding：UTF-8
 * File New Time：2014-10-29 9:18:43
 * Author：水平凡
 * Mailbox：admin@abc3210.com
 */
class LotteryController extends FrontBaseC {

    //抽奖界面
    public function actionIndex() {
        SeoWord::setWord($this, 'getCatSeo', 's11');
//        $this->layout = 'theme.views.layouts.NoCatContent';
//        $this->render('double-11-lottery');
        $GoodsModel = new GoodsModel();
        //双十一
        $this->layout = 'theme.views.layouts.NoCatContent';
        $where = array(
        );
        $cacheKey = md5("getSpecialGoods_5_pc");
        $home_goods = $GoodsModel->getSpecialGoods(5, 0, $where, false, 'default', true, $cacheKey);
        //20个小时内只显示一次
        $value = $this->getCookie('double_11');
        if (empty($value)) {
            $this->setCookie('double_11', $value, time() + 60 * 60 * 20);
            $result = true;
        } else {
            $result = false;
        }
        $this->render('double-11-lottery', array(
            'home_goods' => $home_goods,
            'result' => $result
        ));
    }

}
